<?php if (!empty($this->messages)): ?>    
<?php foreach ($this->messages as $type => $messages): ?>

<div class="messageBox <?php echo $type; ?>">
    <?php foreach ($messages as $message): ?>

    <span><?php echo $message; ?></span>
    <?php endforeach; ?>

</div>
<div class="triangle <?php echo $type; ?>"></div>
<div class="clear"></div>
<?php endforeach; ?>   
<?php endif; ?>